import request from '@/utils/request'

export default {
  /*
	@queryStatistics {Object} : 查询参数
	{
		projectId:[string] -项目Id,
		cubeId:[string] - cubeId,
		startDate:[string] - 开始日期,
		endDate:[string] - 结束日期

	}
*/
  queryStatistics: (params) => request.get('/kylin/query/statistics', {
    params: {
      projectId: params.projectId,
      cubeId: params.cubeId,
      startDate: params.startDate,
      endDate: params.endDate
    }}).then(resp => resp.data),
  queryCount: (params) => request.get('/kylin/query/chart/queryCount', {
    params: {
      projectId: params.projectId,
      cubeId: params.cubeId,
      startDate: params.startDate,
      endDate: params.endDate
    }}).then(resp => resp.data),
  queryTimeData: (params) => request.get('/kylin/query/chart/queryTimeData', {
    params: {
      projectId: params.projectId,
      cubeId: params.cubeId,
      startDate: params.startDate,
      endDate: params.endDate
    }}).then(resp => resp.data),
  queryResponseTime: (params) => request.get('/kylin/query/chart/queryResponseTime', {
    params: {
      projectId: params.projectId,
      cubeId: params.cubeId,
      startDate: params.startDate,
      endDate: params.endDate
    }}).then(resp => resp.data),
  /*
	@jobQuery {Object} jobQuery : 查询参数
	{
		projectId:[string] -项目Id,
		cubeId:[string] - cubeId,
		startDate:[string] - 开始日期,
		endDate:[string] - 结束日期,
		owner:[string] -负责人oa账号
		status:[string] -job状态
    orderBy:[string] -排序属性
    sort:[string] -排序升序降序
	}
	@page {Object} page : 分页
	{
	  page:[integer] -页码
    limit:[integer] -每页条数
	}
*/
  queryDataGrid: (params) => request.get('/kylin/query/datagrid/queryDataGrid', { params }).then(resp => resp.data),
  /*
      md5:[string] -md5,
      startDate:[string] - 开始日期,
		  endDate:[string] - 结束日期
  */
  queryDataGridItem: (params) => request.get('/kylin/query/datagrid/queryDataGridItem', {
    params: {
      md5: params.md5,
      state: params.state,
      startDate: params.startDate,
      endDate: params.endDate
    }
  }).then(resp => resp.data),
  /*
      md5:[string] -md5,
      state:[string] -状态
      startDate:[string] - 开始日期,
		  endDate:[string] - 结束日期
  */
  queryHistory: (params) => request.get('/kylin/query/chart/queryHistory', { params }).then(resp => resp.data),
  /*
      md5:[string] -md5
   */
  rowkeyStats: (params) => request.get('/kylin/query/rowkeyStats', {
    params: {
      md5: params.md5
    }
  }).then(resp => resp.data)
}
